-module('ex_5.4_flow_collection_indicators').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        59,
        true,
        [],
        0,
        60,
        3,
        1,
        false,
        2,
        35,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        29,
        28,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,2,35},
          {yamerl_doc_end,2,35},
          {yamerl_collection_end,2,35,block,mapping},
          {yamerl_collection_end,2,34,flow,mapping},
          {yamerl_scalar,2,28,
            {yamerl_tag,2,28,{non_specific,"?"}},
            flow,plain,"green"},
          {yamerl_mapping_value,2,26},
          {yamerl_scalar,2,23,
            {yamerl_tag,2,23,{non_specific,"?"}},
            flow,plain,"sea"},
          {yamerl_mapping_key,2,23},
          {yamerl_scalar,2,17,
            {yamerl_tag,2,17,{non_specific,"?"}},
            flow,plain,"blue"},
          {yamerl_mapping_value,2,15},
          {yamerl_scalar,2,12,
            {yamerl_tag,2,12,{non_specific,"?"}},
            flow,plain,"sky"},
          {yamerl_mapping_key,2,12},
          {yamerl_collection_start,2,10,
            {yamerl_tag,2,10,{non_specific,"?"}},
            flow,mapping},
          {yamerl_mapping_value,2,8},
          {yamerl_scalar,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            flow,plain,"mapping"},
          {yamerl_mapping_key,2,1},
          {yamerl_collection_end,1,23,flow,sequence},
          {yamerl_scalar,1,18,
            {yamerl_tag,1,18,{non_specific,"?"}},
            flow,plain,"two"},
          {yamerl_sequence_entry,1,18},
          {yamerl_scalar,1,13,
            {yamerl_tag,1,13,{non_specific,"?"}},
            flow,plain,"one"},
          {yamerl_sequence_entry,1,13},
          {yamerl_collection_start,1,11,
            {yamerl_tag,1,11,{non_specific,"?"}},
            flow,sequence},
          {yamerl_mapping_value,1,9},
          {yamerl_scalar,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            flow,plain,"sequence"},
          {yamerl_mapping_key,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
